<html xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"  
      xmlns:c="http://java.sun.com/jsp/jstl/core">  

    <ui:composition template="layout.xhtml">
        <ui:define name="corpo">
            <h:form>
                <div id="breadcrumb">
                    <p:commandLink  actionListener="#{managerIndex.redirect('index.xhtml')}" value="Inicio" update="@form" immediate="true"/> >
                    <p:commandLink  actionListener="#{managerIndex.redirect('indexProtocolo.xhtml')}" value="Protocolo" update="@form" immediate="true"/> > 
                    <p:commandLink  value="Relatório de Protocolos" update="@form" immediate="true"/>
                </div>
                <p:messages showDetail="true"/>
                <p:panel header="Relatório de protocolos">
                    <h:panelGrid columns="2" >
                        <h:outputLabel value="De : " />
                        <p:calendar value="#{managerRelatorioProtocolo.dataInicial}" mode="popup" showOn="both" pattern="dd/MM/yyyy" required="true" requiredMessage="O campo data inicial é obrigatório"/>

                        <h:outputLabel value="Até : " />
                        <p:calendar value="#{managerRelatorioProtocolo.dataFinal}" mode="popup" showOn="both" pattern="dd/MM/yyyy" />

                        <h:outputLabel value="Tipo : " />
                       
                        <p:selectOneMenu value="#{managerRelatorioProtocolo.tipo}">
                            <f:selectItems var="tipo"  value="#{managerRelatorioProtocolo.tipos()}"
                                           itemValue="#{tipo}" itemLabel="#{tipoRelatorio.toString()}" />
                        </p:selectOneMenu>

                    </h:panelGrid>

                    <div class="buttonAction">
                            <p:commandButton value="Gerar" icon="ui-icon-print" ajax="false" 
                                             actionListener="#{managerRelatorioProtocolo.gerar()}"
                                             onclick="this.form.target='_blank'"
                                             update="@form" process="@form" />
                            <p:commandButton value="Voltar" icon="ui-icon-arrowreturnthick-1-w" 
                                             actionListener="#{managerIndex.redirect('index.xhtml')}" immediate="true" />
                    </div>
                </p:panel>
            </h:form>

        </ui:define>
    </ui:composition>

</html>